package com.wanmait.demo.controller.workercontroller;

import com.wanmait.demo.pojo.Notice;
import com.wanmait.demo.service.NoticeService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class NoticeController {
    @Resource
    private NoticeService noticeService;
    @RequestMapping("/worker/notice")
    @ModelAttribute("notices")
    public List<Notice> selectTitleAndContent(){
        return noticeService.selectTitleAndContent();
    }
}
